<!DOCTYPE html>
<html lang="en" style="height: 100%">‘
<h1 onclick="show()">radar图</h1>
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="js/jquery.min.js"></script>
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js"></script>
<script type="text/javascript">
  var dom = document.getElementById("container");
  var myChart = echarts.init(dom);
  var app = {};
  var option;
  option = {
    title: {
      text: '基础雷达图'
    },
    legend: {
      data: ['芝麻信用']
    },
    radar: {
      // shape: 'circle',
      indicator:[

      ]
    },
    series: [{
      name: '芝麻信用',
      type: 'radar',
      data: [
        {
          value: [],
          name: '芝麻信用'
        }
      ]
    }]
  };
  if (option && typeof option === 'object') {
    myChart.setOption(option);
  }

  //异步更新 图表结构
  function show(){
    var url="http://localhost:8081/CG/radar";
    $.get(url).done(function (data){
      // 填入数据
      myChart.setOption({
        legend: {
          data: ['芝麻信用']
        },
        radar: {
          indicator:[]
        },
        series: [{
          // 根据名字对应到相应的系列
          name: '芝麻信用',
          type: 'radar',
          data: [{value:data.data}]
        }]
      });
    });
  }
</script>
</body>
</html>